﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Having.Site.MessageQueue
{
    //// <summary>
    /// 消息队列(接口)
    /// </summary>
    public interface IMessageQueue : IDisposable
    {
        /// <summary>
        /// 链接配置
        /// </summary>
        MQConfig ConnConfig { get; }

        ///// <summary>
        ///// 打开链接
        ///// </summary>
        ///// <returns></returns>
        //void Open();

        /// <summary>
        /// 发送消息
        /// </summary>
        /// <param name="message">消息体</param>
        void SendMessage(string message);
        /// <summary>
        /// 发送消息
        /// </summary>
        /// <param name="message">消息体列表</param>
        void SendMessage(List<string> message);
        /// <summary>
        /// 获取当前消息列表的数量
        /// </summary>
        /// <returns></returns>
        int Count();
        /// <summary>
        /// 接收到的消息对象(不断循环读取，该方法必须用线程)
        /// </summary>
        /// <returns></returns>
        void Receive(Action<string> mi);
        /// <summary>
        /// 清空队列
        /// </summary>
        void Purge();

        /// <summary>
        /// 关闭
        /// </summary>
        void Close();

        


    }
}
